<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>临时交易车辆信息</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <link href="<%=basepath%>css/parking.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
</head>
<body>
<div class="viewport">
    <div class="header">
       <div class="header-1">
           <a href="javascrpt:void(0)" id="join" class="header-2">
              <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
           </a>
           <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes" class="back" id="back">返回</a>
           <span class="span-num">WMP22300</span>
       </div>
    </div>
    <form method="post" id="myForm" action="/wape-web/api/core/centerService">
        <input type="hidden" name="serviceCode" value="MMZS121" />
        <input type="hidden" name="queryType" value="1" />
        <div class="content m-top">
            <div class="blank"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">棚位分区：</td>
                            <td class="td-2">${cp.storeName}
                                <input type="hidden" name="storeId" value="${cp.storeId}" />
                                <input type="hidden" name="storeName" value="${cp.storeName}" /></td>
                            <td class="td-3">编号：</td>
                            <td class="td-4">${cp.sonStoreName}
                                <input type="hidden" name="sonStoreId" value="${cp.sonStoreId}" />
                                <input type="hidden" name="sonStoreName" value="${cp.sonStoreName}" /></td>
                        </tr>
                    </table>
                </div>
            </div>
            <c:if test="${cp.dispatcherDay ne null and cp.dispatcherDay ne '' }">
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">调度员：</td>
                            <td class="td-2">${cp.dispatcherName}</td>
                            <td class="td-3">调度时间：</td>
                            <td class="td-4">${cp.dispatcherDay } ${cp.dispatcherTime }</td>
                        </tr>
                    </table>
                </div>
            </div>
            </c:if>
            <c:if test="${cp.chargesDay_30 ne null and cp.chargesDay_30 ne ''}">
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">收费员：</td>
                            <td class="td-2">${cp.chargerName_30 }</td>
                            <td class="td-3">收费时间：</td>
                            <td class="td-4">${cp.chargesDay_30 } ${cp.chargesTime_30 }</td>
                        </tr>
                    </table>
                </div>
            </div>
            </c:if>
            <c:if test="${cp.payType eq '2'}">
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">车位状态：</td>
                            <td class="td-2">挪车位 </td>
                            <c:if test="${cp.syncTime ne null and cp.syncTime ne ''}">
                            <td class="td-3">挪车时间：</td>
                            <td class="td-4">${cp.syncTime }</td>
                            </c:if>
                        </tr>
                    </table>
                </div>
            </div>
            </c:if>
            <div class="content2-2"><div class="content2-2-1"><span class="span-1">车辆进场情况：</span><!-- <span class="span-2" id="sj">${cp.dispatcherDay } ${cp.dispatcherTime}</span> --></div></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">承租人：</td>
                            <td>
                                <input type="text" class="input-2" value="${cp.plateNum}" name="plateNum" readonly="readonly">
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">联系电话：</td>
                            <td>
                                <c:if test="${(fn:indexOf(cp.inRecordNum, 'tmp_') != -1) }">
                                    <input type="hidden" value="${cp.inRecordNum}" readonly="readonly" class="input-2"  name="inRecordNum" id="inRecordNum">
                                </c:if>
                                <c:if test="${(fn:indexOf(cp.inRecordNum, '_time_') != -1) }">
                                ${fn:substring(cp.inRecordNum, 0, fn:indexOf(cp.inRecordNum, '_time_'))}
                                <input type="hidden" value="${cp.inRecordNum}" readonly="readonly" class="input-2"  name="inRecordNum" id="inRecordNum">
                                </c:if>
                                <c:if test="${(fn:indexOf(cp.inRecordNum, 'tmp_') == -1) and (fn:indexOf(cp.inRecordNum, '_time_') == -1) }">
	                                <input type="text" value="${cp.inRecordNum}" readonly="readonly" class="input-2"  name="inRecordNum" id="inRecordNum">
                                </c:if>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="content2-3"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">收费标准：</td>
                            <td class="td-2">
                                <input type="text" class="input-2 text-r" value="${cp.rate}" name="rate" readonly="readonly" id="js-1">
                            </td>
                            <td class="td-5">元/月</td>
                            <td class="td-3">租赁月数：</td>
                            <td class="td-4">
                                <input type="text" value="${cp.count}" name="count" class="input-2 text-r" placeholder="0" readonly="readonly" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-2">
                            </td>
                            <td class="td-6">月</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="hr"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">应缴费用：</td>
                            <td class="td-2">
                                <input type="text" value="${cp.costs}" name="costs" class="input-2 text-r" placeholder="0" readonly="readonly" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-3">
                            </td>
                            <td class="td-5">元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td class="td-3">优惠金额：</td>
                            <td class="td-4">
                                <input type="text" value="${cp.benefit}" name="benefit" class="input-2 text-r" placeholder="0" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-4">
                            </td>
                            <td class="td-6">元</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="hr"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1">实缴费用：</td>
                            <td class="td-2">
                                <input type="text" value="${cp.payment}" name="payment" class="input-2 text-r" placeholder="0" readonly="readonly" onkeyup="value=value.replace(/[^\d.]/g,'')" id="js-5">
                            </td>
                            <td class="td-5">元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td class="td-4"><input type="text" class="input-2" disabled="disabled" style="border: none;"></td>
                            <c:set var="userRight" value=",15802037299,"></c:set>
                            <c:set var="departRight" value=",2002,200201,200202,"></c:set>
                            <c:if test="${queryType eq '1' || queryType eq '4'}">
                                <c:if test="${cp.carDispatcherType eq '20' and ((fn:indexOf(userRight, user.atUserId) != -1) or (fn:indexOf(departRight, user.departmentId) != -1))}">
                                    <td class="td-7">
                                        <input type="button" class="button" value="确认缴费" id="abcd">
                                    </td>
                                </c:if>
                            </c:if>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="content2-3"></div>
            <div class="blank"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1 bold">商品种类：</td>
                            <td class="td-2">
                                <input type="text" class="input-2 text-left" value="${cp.goodsKingdom}" name="goodsKingdom" readonly="readonly" id="js-1">
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="hr"></div>
            <div class="content2-1">
                <div class="content2-1-1">
                    <table>
                        <tr>
                            <td class="td-1 bold">商品名称：</td>
                            <td>
                                <input type="text" class="input-2 text-left" value="${cp.goodsInfo}" name="goodsInfo" readonly="readonly">
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="blank"></div>
            <div class="content2-2"><div class="content2-2-1"><span>其他备注情况</span></div></div>
            <div class="content2-4"><textarea rows="" cols="" name="remark" readonly="readonly">${cp.remark}</textarea></div>
            <c:if test="${cp.chargesDay_30 ne null and cp.chargesDay_30 ne ''}">
            <div class="blank-1"></div>
			<div class="vehicle5-3"><div class="vehicle5-3-1"><a href="/wape-web/api/core/centerService?serviceCode=MMZS205&atUserId=${user.atUserId}&inRecordNum=${cp.inRecordNum}&storeId=${cp.storeId}&sonStoreId=${cp.sonStoreId}&payType=${cp.payType}" class="print">打印单据</a></div></div>
            </c:if>
            <div class="space"></div>
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
    /*错误提示*/
    $(function(){
        var error = "${requestScope.returnMsg}";
        if(error != "" && error != "成功!"){
            layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        }
    });
    /*时间*/
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }

        var hours = date.getHours()>9?date.getHours():("0"+date.getHours());
        var minutes = date.getMinutes()>9?date.getMinutes():("0"+date.getMinutes());
        var seconds = date.getSeconds()>9?date.getSeconds():("0"+date.getSeconds());
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                + " " + hours + seperator2 + minutes
                + seperator2 + seconds;
        sj.innerHTML=currentdate;
    }
    $(function(){
        //var  queryType = '${queryType}';
        //if(queryType == '1' || queryType == '4') {
        //    setInterval("getNowFormatDate()",1000);
        //}
    });
    /*计算*/
    $(function(){
    	/*
        $("#js-2").keyup(function(){
            var s1 = $("#js-1").val();
            var s2 = $("#js-2").val();
            var s4 = $("#js-4").val();
            var s3 = Math.round(s1*s2*100)/100;
            $("#js-3").val(s3);
            var s5 = Math.floor(Number(s3)-Number(Math.round(s4)));
            $("#js-5").val(s5);
        });
        */
        
        $("#js-4").keyup(function(){
            var s1 = $("#js-1").val();
            var s2 = $("#js-2").val();
            var s4 = $("#js-4").val();
            var s3 = Math.round(s1*s2*100)/100;
            $("#js-3").val(s3);
            var s5 = Math.floor(Number(s3)-Number(Math.round(s4)));
            if(s5 < 0) {
                layer.msg("优惠金额应小于应缴金额",{shadeClose:true,shade:0.1,time:2000});
                $("#js-4").val('0');
                s5 = s1*s2;
            }
            $("#js-5").val(s5);
        });
    });
    /*提交*/
    $(function(){
        $("#abcd").click(function(){
            layer.confirm('您确认提交吗', {icon: 3, title:'提交'}, function(index){
                $("#myForm").submit();
                layer.close(index);
            });
        });
    });
</script>
</html>


